<!DOCTYPE html>
 <html lang="en">

 <head>
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <meta http-equiv="X-UA-Compatible" content="ie=edge">

     <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
     <script src="script/jquery.min.js"></script>
     <script src="script/bootstrap.min.js"></script>

     <link rel="stylesheet"  href="css/reset.css">
     <link rel="stylesheet"  href="css/index.css">

         <title>Document</title>
         <style>
li{
    list-style: none;
}
         </style>
     </head>
 <body>

 <!--<div class="index-nav" >--><!--#1E9FFF-->
     <div class="container" style="background: #1E9FFF;width: 90%;text-align: center;height: 65px">
     <div class="index-nav-frame clearfix" >

         <img src="../2-post/images/logo.png" alt="" class="layui-circle" style="height: 60px;width: 80px;margin-top: 5px;margin-left:-970px">
         <span style="font-size: x-large;color: #0C0C0C;font-weight: bolder;position: relative;top: 4px;left: 5px">爱车论坛</span>

         <a href="../cln/jsp/car.jsp" >
             <span style="font-size: x-large;font-weight: bolder;position: absolute;top: 13px;left:450px;color: #B1E1FF">去看车</span></a>

         <!--<li class="layui-nav-item" style="margin-left: 50px;list-style: none;display: inline" id="first">-->


<ul>

         <li style="float: right;margin-top: -45px;margin-right: 150px">
         <a href="../4_user/personself/index.html">
             <span style="font-size: medium;color: #B1E1FF">个人中心</span>
         </a>
     </li>


         <li style="float: right;margin-top: -45px;margin-right: 250px">
             <a href="../4_user/personself/index.html" class="noLog">
             <span style="font-size: medium;color: #B1E1FF">登录</span>
             </a>

             <a href="" class="Log">
             <span style="font-size: medium;color: #B1E1FF">退出登录</span>
             </a>
         </li>

         <li style="float: right;margin-top: -45px;margin-right: 350px">
         <a href="../4_user/personself/index.html" class="regist">
             <img src="" class="layui-nav-img" style="margin-top: 15px">
             <span style="font-size: medium;color: #B1E1FF">注册</span>
         </a>

             <a href="../4_user/personself/index.html" class="userInfo">
                 <img class="userImg" style="margin-top: 15px">
                 <span style="font-size: medium;color: #B1E1FF" class="userName"></span>
             </a>
     </li>

</ul>
     </div>
     </div>
 </div>


 <script>
     var html1 = "<li class=\"layui-nav-item\" style=\"float: right\">\n" +
         "                    <a href=\"javascript:void(0);\" onclick='qing()'><span style=\"font-size: medium\">个人中心</span></a></li><li class=\"layui-nav-item\" style=\"float: right\">\n" +
         "                <a href=\"../cln/jsp/login.jsp\"><span style=\"font-size: medium\">登录</span></a>\n" +
         "            </li>\n" +
         "            <li class=\"layui-nav-item\" style=\"float: right\">\n" +
         "                    <a href=\"../cln/jsp/login.jsp\"><span style=\"font-size: medium\">注册</span></a>\n" +
         "            </li>";
     $.ajax({
         url: '/forum/user/getUserInfo',
         type: 'get',
         dataType: 'json',
         success: function (data) {
             if (data.state == '0') {
                 alert(data.state)
                 $('.noLog').show();
                 $('.Log').hide();
                 $('.userInfo').hide();
                 $('.regist').show();
             }else if (data.state == '200'){
                 // 登录了
                 var parm = "userName=" + data.data.userName;
                 $.ajax({
                     url:"/forum/usercenter/selectByUsetName",
                     data:parm,
                     type:"post",
                     success:function (data) {
                         $('.userImg').attr("src",data.userPhoto);
                         $('.userName').text(data.userName);
                         $('.regist').hide();
                         $('.noLog').hide();
                         $('.Log').show();
                         $('.userInfo').show();
                     }
                 })
             }
         }
     })


     function qing() {
         alert("请先去登录")
     }

     function layout() {
         // 退出登录



     }
 </script>



 </body>
 </html>
